<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link href="css/base.css?v=20140102" rel="stylesheet" type="text/css" />
<title></title>
</head>
<style>
.tab  td{ border:0px solid #999;border-bottom:1px solid #999; }
.tab {
	width:100%;
	border-spacing:20px;
	font-size:20px;
	background-color:#FFFFFF;
	}
</style>
<body>
<div class="viewport" id="main_content"/>

<script type="text/javascript" src="js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="js/handlebars-v1.2.0.js"></script>

<script id="entry-template" type="text/x-handlebars-template">
<table class="tab">
	{{#each PayList}}
    <tr>
    	<td  align="right" nowrap="nowrap" width="40%">
        	<b>{{PayName}}:</b>
        </td>
        <td align="left" width="60%">
			{{#if PayMoney}}
        	¥{{PayMoney}}
			{{else}}
        	<font color=red>¥{{PayMoney}}</font>
			{{/if}}
        </td>
    </tr>
	{{/each}}
	<tr>
	  <td  align="right" nowrap="nowrap" width="40%">
        	<b>合计:</b>
        </td>
        <td align="left" width="60%">
        	¥{{Total}}
        </td>
	</tr>
</table>
</script>

<script type="text/javascript">
	   var source=$("#entry-template").html();
       var template = Handlebars.compile(source);
       eval( 'var context=' + window.android.getjson() );
	    //var context = {"Total":434555,"PayList":[{"PayName":"现金","PayMoney":120597.8},{"PayName":"消费赠券","PayMoney":60},{"PayName":"银行卡(高)","PayMoney":1.34},{"PayName":"银行卡(低)","PayMoney":62035},{"PayName":"资金卡","PayMoney":72687.9},{"PayName":"抵用券","PayMoney":186}],"Result":"1","Message":""};
	   
	   if (context.Result == 0 ){
		   alert( context.Message );
	   } 
	   var html = template( context );
       $("#main_content").html( html ); 
</script>

</body>
</html>
